package com.yunsc.order.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.yunsc.common.validator.ValidationGroups;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @version: 1.0
 * @Author: adan
 * @description:
 * @date: 2024-05-02 18:14
 */
@Data
public class OrderDeliveryDTO {
    @JsonProperty("orderId")
    @NotNull(message = "订单id不能为空", groups = {ValidationGroups.Update.class, ValidationGroups.Delete.class})
    private Integer orderId;
    private OrderExpressForm form;

    @Data
    public static class OrderExpressForm {
        @NotNull(message = "物流id不能为空", groups = {ValidationGroups.Update.class})
        @JsonProperty("expressId")
        private Integer expressId;

        @NotNull(message = "物流订单no不能为空", groups = {ValidationGroups.Update.class})
        @JsonProperty("expressNo")
        private String expressNo;
        @JsonProperty("deliveryMethod")
        private Integer deliveryMethod;
        @JsonProperty("packGoodsData")
        private List<PackGoodsData> packGoodsData;
        // 同步微信平台物流信息 0 不同步； 1 同步
        @JsonProperty("syncMpWeixinShipping")
        private String syncMpWeixinShipping;
        // 审核状态 1 同意； 0 拒绝
        private Integer status;
        // 商家备注
        private String content;
    }

    @Data
    public static class PackGoodsData {
        @JsonProperty("deliveryNum")
        @NotNull(message = "发货数量不能为空", groups = {ValidationGroups.Update.class})
        private Integer deliveryNum;
        @JsonProperty("orderGoodsId")
        @NotNull(message = "订单商品id不能为空", groups = {ValidationGroups.Update.class})
        private Integer orderGoodsId;
    }
}
